﻿using System.Text.Json.Serialization;
using XYS.Core.Models;

namespace XYS.Service.Core.EventBus.Events
{
    /// <summary>
    /// 集成事件
    /// </summary>
    public record IntegrationEvent
    {
        /// <summary>
        /// 集成事件
        /// </summary>
        public IntegrationEvent()
        {
            Id = Guid.NewGuid();
            CreationDate = DateTime.Now;
            ServiceName = GlobalCoreSetting.ServiceName;
            ServiceIP = GlobalCoreSetting.NACOS_IP;
            ServicePort = GlobalCoreSetting.NACOS_PORT;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <param name="createDate"></param>
        public IntegrationEvent(Guid id, DateTime createDate)
        {
            Id = id;
            CreationDate = createDate;
        }
        /// <summary>
        /// 
        /// </summary>
        public Guid Id { get; private init; }
        /// <summary>
        /// 
        /// </summary>
        public string ServiceName { get; private init; }
        /// <summary>
        /// 
        /// </summary>
        public string ServiceIP { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string ServicePort { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public DateTime CreationDate { get; private init; }
    }
}
